package com.example.hospitalmanagementapp

import adapter.ReportAdapter
import android.graphics.drawable.GradientDrawable
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.activity_report.*
import kotlinx.android.synthetic.main.report_item.*
import util.TimeSelectedUtil

class ReportActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_report)
        initView()
    }

    private fun initView() {
        //加载布局管理器和适配器
        report_check.layoutManager=LinearLayoutManager(this,RecyclerView.VERTICAL,false)
        val dataList:MutableList<PeopleInformationModel> = mutableListOf(
        PeopleInformationModel("王凡","612326*******591X")
        )
        val reportAdapter=ReportAdapter(this)
        reportAdapter.dataList=dataList
            report_check.adapter=reportAdapter
        //开始日期
        start_date.setOnClickListener {
            val pickerView=TimeSelectedUtil(this).timeSelected()
            pickerView.show(start_date)
        }
        //截止日期
        end_date.setOnClickListener {
            val pickerView=TimeSelectedUtil(this).timeSelected()
            pickerView.show(end_date)
        }
    }
}